import userUserStore from "@/stores/user";
import { showToast } from 'vant';
export default function () {
    let { uid, token, userInfo, tokenExpired, names, nickname } = localStorage;
    const { saveInf, saveUid, saveToken, saveIslogin, saveNa, saveNick } = userUserStore();
    // console.log(uid, token, userInfo, tokenExpired);
    if (uid && token) {
        let now = new Date().getTime()
        if (now >= tokenExpired) {
            showToast("000")
            localStorage.clear()
        } else {
            saveInf(JSON.stringify(userInfo));
            saveUid(uid);
            saveToken(token);
            saveIslogin(true);
            saveNa(names)
            saveNick(nickname);
        }
    }
}